<?php
    require_once( dirname(__FILE__).'/bencode.php' );

	$bc = new AC_Bencode();

	$i = 42;
	$b = true;
	$s = 'hello';
	$l = array( 1, 2, 3, "hello" );
	$l2 = array( $l, array( $l ), array( array( $i, $s, $l ) ) );

	$d = array( 'a'=>'hello', 'bcd'=>'world', 3=>5 );
	$d2 = array( $d, array( $d ), array( array( $i, $s, $l, $d ) ), $i );

	$_d2 = $bc->encode( $d2 );
	var_export( $_d2 ); echo "\n";
	$d2_ = $bc->decode( $_d2 );
	var_export( $d2_ ); echo "\n";
	echo "\n";

/*
	$_i = $bc->encode( $i );
	var_export( $_i ); echo "\n";
	$i_ = $bc->decode( $_i );
	var_export( $i_ ); echo "\n";
	echo "\n";
*/
/*
	$_s = $bc->encode( $s );
	var_export( $_s ); echo "\n";
	$s_ = $bc->decode( $_s );
	var_export( $s_ ); echo "\n";
	echo "\n";
*/
/*
	$_l = $bc->encode( $l );
	var_export( $_l ); echo "\n";
	$l_ = $bc->decode( $_l );
	var_export( $l_ ); echo "\n";
	echo "\n";
*/
/*
	$_l2 = $bc->encode( $l2 );
	var_export( $_l2 ); echo "\n";
	$l2_ = $bc->decode( $_l2 );
	var_export( $l2_ ); echo "\n";
	echo "\n";
*/
/*
	$_d = $bc->encode( $d );
	var_export( $_d ); echo "\n";
	$d_ = $bc->decode( $_d );
	var_export( $d_ ); echo "\n";
	echo "\n";
*/
?>

